Functional electrical stimulation through medical device